{extends file="./main.tpl"}
{block name=head}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="./js/jquery.js" type="text/javascript"></script>
<script src="./js/jquery.dataTables.js" type="text/javascript"></script>

<style type="text/css">
  @import "./css/demo_table_jui.css";
  @import "./themes/ui-lightness/jquery-ui-1.8.4.custom.css";
</style>

<style>
  *{
      font-family: arial;
  }
</style>
<script type="text/javascript" charset="utf-8">
  $(document).ready(function(){
  	$('#filterOn').val('{$filterOn}');
    $('#datatables').dataTable({
      "sPaginationType":"full_numbers",
      "aaSorting":[[0, "asc"]],
      "bJQueryUI":true
    });
  })
</script>
{/block}
{block name=body}
<div style="width: 600px;	margin: 30px auto;	padding: 0;">
<center><h1>Account Summary</h1></center>
<center>
	<form name="filterForm" method="get">
	<select name="filterOn" id="filterOn" onchange="this.form.submit();"> 
		<option value="">All</option>
		<option value="dayBook">Is Day Book</option>
		<option value="party">Is Party</option>
		<option value="general">General</option>
	</select>
	</form>	
</center>
<table id="datatables" class="display">
  <thead>
  <tr>
    <th>Account Name</th>
    <th>Credit</th>
    <th>Debit</th>
  </tr>
  </thead>
  <tbody>
  {section name="sec" loop=$accArray}
  <tr>
  	<td><a href="summaryDetail.php?accountId={$accArray[sec].accountId}">{$accArray[sec].accountName} {if {$accArray[sec].partyCode} != ''}  --||-- Party Code : {$accArray[sec].partyCode}{/if}</a></td>
  	{if $accArray[sec].finalAmount != 0}  	
    	{if $accArray[sec].finalAmount > 0}  	
    	  <td align="right">{$accArray[sec].finalAmount|string_format:"%.2f"}</td>
    	  <td>&nbsp;</td>
    	{else}
    	  <td>&nbsp;</td>
    	  <td align="right">{$accArray[sec].finalAmount|string_format:"%.2f"}</td>
    	{/if}  
  	{else}  
    	<td>&nbsp;</td>
    	<td>&nbsp;</td>
  	{/if}  
  </tr>	
  {/section}
  </tbody>
  <tfoot>
  <tr>
  	<th align="right">Total : </th>
  	<th align="right">{$totCrAmt|string_format:"%.2f"}&nbsp;&nbsp;</th>
  	<th align="right">{$totDrAmt|string_format:"%.2f"}&nbsp;&nbsp;</th>
  </tr>  
  <tr>
  	<th align="right">Final Amount: </th>
  	<th colspan="2">{$totAmt|string_format:"%.2f"}</th>
  </tr>
  </tfoot>
</table>
{/block}